home *** CD-ROM | disk | FTP | other *** search
- Path: watnews.watson.ibm.com!ncohen
- From: ncohen@watson.ibm.com (Norman H. Cohen)
- Newsgroups: comp.lang.ada,comp.lang.c++
- Subject: Re: on OO differnces between Ada95 and C++
- Date: 27 Feb 1996 18:55:07 GMT
- Organization: IBM T.J. Watson Research Center
- Distribution: world
- Message-ID: <4gvk2b$sjq@watnews1.watson.ibm.com>
- References: <4gbq7q$g08@qualcomm.com> <Dn4J2F.uI@bton.ac.uk> <4gh204$l7n@qualcomm.com> <DnDuA4.8GC@bton.ac.uk>
- Reply-To: ncohen@watson.ibm.com
- NNTP-Posting-Host: rios8.watson.ibm.com
-
- In article <DnDuA4.8GC@bton.ac.uk>, je@bton.ac.uk (John English) writes:
-
- |> Nasser Abbasi (nabbasi@qualcomm.com) wrote:
- ...
- |> : If what you say was the case, then types defined in package "A"
- |> : will be seen by clients to a package "B" where "B" has with'ed A. But
- |> : it is not so. Clients of "B" must also 'with' "A" to see types defined
- |> : in "A" even though "B: has allready with'ed "A".
- |>
- |> If you're right this would be a real pain.
-
- But he is, and it isn't.
-
- |> Clients of a package would have
- |> to know (recursively) what other packages the spec(s) reference; if the
- |> spec for X "withs" a package Y so it can use type Y.T as a procedure
- |> parameter then you wouldn't be able to use X without Y (i.e. "with X"
- |> on its own would be useless; you'd have to have "with X, Y" and probably
- |> other things as well if Y has any "with" clauses in its specification.
-
- If a client of X has a with clause for Y, it is not because X has a with
- clause for Y, but because the client itself is using a facility provided
- by Y. Specifically, if the client calls your procedure with a parameter
- of type Y.T, then it is using that type. If X's client does not call
- that procedure, it may not need a with clause for Y.
-
- Furthermore, for the convenience of its clients, X can contain a
- declaration such as
-
- subtype T is Y.T;
-
- which causes X to reexport the type originally declared in Y. Then X's
- client can refer to the type (as X.T) without a with clause for Y.
-
- --
- Norman H. Cohen ncohen@watson.ibm.com
-